/*
	write a program that takes a file as an argument and counts the total number of lines.
	Lines are defined as ending with a newline character. Program usage should be
	count filename.txt
	and the output should be the line count.
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main( int argc, char* argv[] ){

	int NumLines = 0;
	string Line;
	int RetVal = -1;

	char *FileName = argv[1];
	ifstream InFile(FileName);

	while (getline(InFile, Line)) NumLines ++;

	InFile.close();

	cout << NumLines << endl;

	RetVal = NumLines;

	return RetVal;

}
